V2EX  ›  英汉词典

Static Type Checking

Definition / 定义

“Static type checking(静态类型检查)”指在程序运行之前(通常在编译阶段),由编译器或工具根据代码中的类型信息检查类型是否匹配,从而尽早发现诸如把字符串当作数字使用、函数参数类型不正确等错误。它常见于如 Java、C#、Rust、Haskell、Go(部分场景)等语言与其工具链中。

Pronunciation / 发音

/ˈstætɪk taɪp ˈtʃekɪŋ/

Examples / 例句

Static type checking can catch many bugs before the program runs.
静态类型检查可以在程序运行前捕捉到许多错误。

Because of static type checking, the compiler rejected the code that passed a string to a function expecting an integer.
由于静态类型检查,编译器拒绝了那段把字符串传给“需要整数”的函数的代码。

Etymology / 词源

“Static”源自希腊语 statikos(“使……站立的、静止的”),在计算机领域常引申为“在运行前就确定的”;“type”来自拉丁语 typus(“类型、范式、印记”);“checking”来自古法语/英语中“检查、核对”的含义。合起来,“static type checking”字面意思就是“在静态阶段(运行前)进行类型核对”。

Related Words / 相关词

Literary Works / 文学作品

  • Types and Programming Languages(Benjamin C. Pierce)——系统讲解类型系统与(含静态)类型检查的经典教材。
  • Programming Language Pragmatics(Michael L. Scott)——讨论多种语言设计取舍,包括静态类型检查在工程中的作用。
  • The Rust Programming Language(Steve Klabnik, Carol Nichols)——以 Rust 为例介绍编译期(静态)类型检查如何提升可靠性。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   682 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 20:52 · PVG 04:52 · LAX 12:52 · JFK 15:52
♥ Do have faith in what you're doing.